package com.netease.financial.data.net;

import com.netease.financial.data.body.LoginBody;
import com.netease.financial.data.body.PageBody;
import com.netease.financial.data.body.RegisterBody;
import com.netease.financial.data.entity.AccessTokenCheckEntity;
import com.netease.financial.data.entity.AppUpdateEntity;
import com.netease.financial.data.entity.LaunchPageEntity;
import com.netease.financial.data.entity.LoginEntity;
import com.netease.financial.data.entity.LogoutEntity;
import com.netease.financial.data.entity.ActivityPageEntity;
import com.netease.financial.data.entity.PageInfoEntity;
import com.netease.financial.data.entity.RegisterEntity;
import com.netease.financial.data.entity.UnreadMessageCountEntity;

import java.util.List;
import java.util.Map;

import retrofit.http.Body;
import retrofit.http.Header;
import retrofit.http.Query;
import rx.Observable;

/**
 * Created by wyf on 11/12/15.
 */
public abstract class NfsRestApiServiceWrapper implements NfsRestApiService {

    private final NfsRestApiService mNfsRestApiService;

    public NfsRestApiServiceWrapper(NfsRestApiService nfsRestApiService) {
        mNfsRestApiService = nfsRestApiService;
    }

    @Override
    public Observable<AppUpdateEntity> getAppUpdateInfo(
            @Query("device") String device,
            @Query("versionCode") int versionCode) {
        return mNfsRestApiService.getAppUpdateInfo(device, versionCode);
    }

    @Override
    public Observable<UnreadMessageCountEntity> getUnreadMessageCount(
            @Header("x-auth-token") String accessToken) {
        return mNfsRestApiService.getUnreadMessageCount(accessToken);
    }

    @Override
    public Observable<LoginEntity> login(
            @Body LoginBody body,
            @Header("AppSecret") String appSecret) {
        return mNfsRestApiService.login(body, appSecret);
    }

    @Override
    public Observable<LogoutEntity> logout(
            @Header("x-auth-token") String accessToken,
            @Header("AppSecret") String appSecret) {
        return mNfsRestApiService.logout(accessToken, appSecret);
    }

    @Override
    public Observable<AccessTokenCheckEntity> checkAccessToken(
            @Query("x-auth-token") String accessToken,
            @Header("AppSecret") String appSecret) {
        return mNfsRestApiService.checkAccessToken(accessToken, appSecret);
    }

    @Override
    public Observable<ActivityPageEntity> getActivityPageInfo() {
        return mNfsRestApiService.getActivityPageInfo();
    }

    @Override
    public Observable<LaunchPageEntity> getLaunchPageInfo(
            @Query("widthPixels") int widthPixels,
            @Query("heightPixels") int heightPixels,
            @Query("platform") String platform) {
        return mNfsRestApiService.getLaunchPageInfo(widthPixels, heightPixels, platform);
    }

    @Override
    public Observable<RegisterEntity> register(
            @Body RegisterBody body,
            @Header("AppSecret") String appSecret) {
        return mNfsRestApiService.register(body, appSecret);
    }

    @Override
    public Observable<PageInfoEntity> getPageInfo(@Body PageBody body) {
        return mNfsRestApiService.getPageInfo(body);
    }

}
